<template>
	<view class="collect">
		<goods-cart v-if="gooodsInfo.length" :goods-info="gooodsInfo" @reGerGoodsInfo="getGoodsCollect"
			goodsType="collect"></goods-cart>
		<view v-else class="null-collect">
			<image src="https://hbimg.b0.upaiyun.com/f5a2b1c0b3ab3f82f8131aea2ec3ffe253efc3d52290-hImI2N_fw658"></image>
		</view>
	</view>
</template>

<script>
	import goodsCart from '../goods/goodCards.vue'
	import collectApi from '../../api/avatar/avatar.js'
	export default {
		data() {
			return {
				gooodsInfo: []
			}
		},
		components: {
			goodsCart
		},
		onShow() {
			this.getGoodsCollect()
		},
		methods: {
			async getGoodsCollect() {
				let res = await collectApi.goodsCollect()
				if (res.code == 200) {
					this.gooodsInfo = res.list
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.null-collect {
		background-color: #fff;
		width: 750rpx;
		height: calc(100vh - 90rpx);
		display: flex;
		align-items: center;
		justify-content: center;
	}
</style>